<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
//exit();
set_time_limit(0);
declare(ticks = 1);
include("AllWeb.inc.php");

//樣版資料庫
$arrWeb[] = "SourceSite-utf8";

exec("rm -f /var/log/cronjob/lotto.dbupdate.log  &");
foreach($arrWeb as $strWeb){
	$pcid = pcntl_fork();
	if ($pcid == -1) {
		die("Could not fork!");
	}elseif ($pcid) {	//if ($pcid == -1)//
		print "There are $strWeb kids to terminate.".date("Y-m-d H:i:s")."\n";
	}else{	//if ($pcid == -1)//
		if (!posix_setsid()) { die ("Could not detach"); }; // detach
		print "I am child number ".$strWeb."Time: ".date("Y-m-d H:i:s")."\n";

		switch($strWeb){
			//case "3d.usbet33.us":
			//case "tien.usbet33.us":
			//case "kly.uswin.us":
				//break;

			default:
				print exec("php -c / -f ./sDBUpdate.php ".$strWeb." >> /var/log/cronjob/lotto.dbupdate.log  &");
				break;
		}
		exit();
	} //if ($pcid == -1)//
} //foreach($arrWeb as $strWeb)//
?>